var skin = document.getElementById('skin');
if(skin) {
	var skin_ul = skin.getElementsByTagName('ul')[0];
	skin.onmouseover = function() {
		skin_ul.style.display = 'block';
	};
	skin.onmouseout = function() {
		skin_ul.style.display = 'none';
	};
}

var me = document.getElementById('me');
if(me) {
	var name_ul = me.getElementsByTagName('ul')[0];
	me.onmouseover = function() {	
		name_ul.style.display = 'block';
	};
	me.onmouseout = function() {	
		name_ul.style.display = 'none';
	};
}


//换皮肤功能
var arrPiFu=document.getElementsByClassName('pifu');
//
//默认无皮肤
arrPiFu[0].onclick=function(){
	document.body.style.background="#FFE4E1";
	var bg=document.body.style.background;
	document.cookie="bg="+bg;
}
//皮肤一
arrPiFu[1].onclick=function(){
	document.body.style.background="#AFEEEE";
	var bg=document.body.style.background;
	document.cookie="bg="+bg;
}
//皮肤二
arrPiFu[2].onclick=function(){
	document.body.style.background="#FAFAD2";
	var bg=document.body.style.background;
	document.cookie="bg="+bg;
}
//					封装获得cookie值函数,调用方式传参key,会返回对应值
function getCookie(key){
	var arr1=document.cookie.split("; ")
	for(var i=0;i<arr1.length;i++){
		var arr2=arr1[i].split("=");
		if(arr2[0]==key){
			return decodeURI(arr2[1]);
		}
		
	}
}
//载入皮肤数据
function loadPiFu(){
	document.body.style.background=getCookie('bg');
}
loadPiFu();

